<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../baselayout/import.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${staticPath}/assets/css/bootstrap.min.css">
<link rel="stylesheet" href="${staticPath}/assets/css/admin.css">
<link rel="stylesheet" href="${staticPath}/assets/css/da-slider.css">
<link rel="stylesheet" href="${staticPath}/css/fakeLoader.css">

<link rel="stylesheet" href="${staticPath}/css/ladda-themeless.min.css">
<!-- <link rel="stylesheet" href="css/prism.css"> -->
<title>管理员页面</title>
</head>
<body>
	<div class="fakeloader"></div>
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span> <span class="icon-bar"></span> 
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">管理页面</a>
			</div>
			<div id="navbar" class="navbar-collapse collapse">
				<ul class="nav navbar-nav navbar-right">
					<li><a href="javascript:void(0)">苟利国家生死以,岂因祸福避趋之</a></li>
					<li><a href="javascript:void(0)" class="glyphicon glyphicon-user">欢迎您, ${sessionScope.name}</a></li>
					<li><a href="#">返回首页</a></li>
				</ul>
			</div>
		</div>
	</nav>
	<div class="container offdown">
		<div class="row fullscreen">
			<div class="col-md-3 col-sm-3 h100 sidebar">
				<ul class="nav nav-sidebar menu">
					<li data-url="/wechat/admin/welcome.do" class="active"><a href="javascript:void(0)">首页</a></li>
					<li data-url="/wechat/admin/display.do"><a href="javascript:void(0)">数据集管理</a></li>
					<li data-url="/wechat/admin/primaryuser.do"><a href="javascript:void(0)">用户管理</a></li>
<!-- 					<li data-url="/wechat/admin/tfidf.do"><a href="javascript:void(0)">TFIDF模型</a></li>
					<li data-url="/wechat/admin/word2vec.do"><a href="javascript:void(0)">Word2Vec模型</a></li>
					<li data-url="/wechat/admin/lda.do"><a href="javascript:void(0)">LDA模型</a></li> -->
					<li data-url="/wechat/admin/classification.do"><a href="javascript:void(0)">文本分类页面</a></li>
					<li data-url="/wechat/admin/task/submitted_task.do"><a href="javascript:void(0)">任务状态表</a></li>
					<li data-url="/wechat/admin/main.do"><a href="javascript:void(0)">系统参数</a></li>
				</ul>
				<div class="footer text-center">
					<p>此情可待成追忆</p>
				</div>
			</div>	
			<div class="col-md-9 col-sm-9 h100 content">
				<!-- <p class="breadcrumb">当前位置:管理/春如旧</p> 导航位置自己看着办-->
				<div id="main" class="main" >
	<%-- 			   <h1>欢迎访问管理员界面.您的账号是 ${userid} </h1>	 移动到welcome.jsp--%>
				</div>
			</div>
		</div>
	</div>
	<div class="footer">
		<footer>
			<p class="text-center" style="margin:20px 0 20px 0">版权所有 北京交通大学交通数据挖掘实验室</p>
			 <ul class="list-inline text-center" style="margin: 20px 0 0 0">
				<li><a href="#">天不老</a></li>
				<li><a href="#">情难绝</a></li>
				<li><a href="#">心似双丝网</a></li>
				<li><a href="#">中有千千结</a></li>
				<li>曾经沧海难为水,除去巫山不是云 <a href="#">代码如诗</a></li>
			</ul>
		</footer>
	</div>
</body>
<script src="${staticPath}/js/jQuery-1.9.1.js"></script>
<script src="${staticPath}/js/bootstrap.min.js"></script>
<script src="${staticPath}/assets/js/figure/highcharts.js"></script>
<script src="${staticPath}/js/fakeLoader.js"></script>
<script src="${staticPath}/js/spin.min.js"></script>
<script src="${staticPath}/js/ladda.min.js"></script>
<script src="${staticPath}/js/my.js"></script>
<script src="${staticPath}/js/jquery.form.js"></script>
<script>
$(document).ready(function(){
	var loader = $(".fakeloader").fakeLoader({
        timeToHide:10000000,
        bgColor:"rgba(52,152,219,0.4)",//#3498db
        spinner:"spinner2"
    });
	window.loader = loader;
	var oldajax = $.ajax;
	$.oAjax = oldajax;
	$.ajax = function(obj){
		successcallback = obj.success;
		errorcallback = obj.error;
		function succ(data){
			loader.fadeOut();
			if(typeof successcallback != 'undefined')
				successcallback(data);
			
		}
		function err(e){
			loader.fadeOut();
			if(typeof errorcallback != 'undefined')
				errorcallback(e);
		}
		loader.css('display','block');
		obj.success=succ;
		obj.error = err;
		oldajax(obj);
	}
	var currentLi = null;
	$("ul.nav-sidebar li").each(function(idx){
		var $li = $(this);
		$li.on("click",idx,function(event){
			$("ul.nav-sidebar li").removeClass("active");
			$(this).addClass("active");
			var idx = event.data;
			var url = $li.attr('data-url');
			currentLi = $(this);
			if(typeof url != 'undefined'){
				$.ajax({
					url:url,
					type:'get',
					success:function(data){
						$("#main").html(data);
						/* loader.fadeOut(); */
					},
					error:function(err){
					/* 	loader.fadeOut(); */
						console.log(err);
					}
				});
				/*  $(".fakeloader").css('display','block'); */
			}
			window.scrollTo(0,0)
		});
	})
	//打开首页
	$("ul.nav-sidebar li:first").click();
	window.refreshSelf = function(){
		if(typeof currentLi != 'undefined'){
			$(currentLi).click();	
		}
	}
	
	window.compileAjaxButtons = function(scope,callback){
		scope == scope || window;
		$("[data-ajax]",scope).each(function(){
			var btn = $(this);
			var obj = btn.attr("data-ajax");
			var json = JSON.parse(obj) || {};
			console.log(json.url);
			console.log(json.params);
			btn.click(function(){
				$.ajax({
					'url':json.url,
					'type':'post',
					'data':json.params || json.data,
					success:function(data){
						messageBox('成功',data);
					},
					error:function(err){
						messageBox('失败','WEB服务器错误');						
					}
				})
			})

		});
		if(typeof callback != 'undefined' && typeof callback == 'function') {
			callback();
		}
		
	}
	
	
		
})
</script>
</html>